package com.youlu.campus.admin.item;

import com.youlu.campus.common.base.RestResult;
import com.youlu.campus.common.base.RestResultBuilder;
import com.youlu.campus.entity.ActivityCultureCreativeConfig;
import com.youlu.campus.entity.VO.req.ItemQueryReq;
import com.youlu.campus.service.item.ActivityCultureCreativeConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 活动文创管理
 */
@RestController
public class ActivityCultureCreativeConfigController {

    @Autowired
    private ActivityCultureCreativeConfigService activityCultureCreativeConfigService;

    @PostMapping("/activity/culture-creative-config/save")
    public RestResult saveOrUpdate(@RequestBody ActivityCultureCreativeConfig activityCultureCreativeConfig) {
        activityCultureCreativeConfigService.saveOrUpdate(activityCultureCreativeConfig);
        return RestResultBuilder.builder().success().data(null).build();
    }

    @PostMapping("/activity/culture-creative-config/list")
    public RestResult list(@RequestBody ItemQueryReq itemQueryReq) {
        return RestResultBuilder.builder().success().data(activityCultureCreativeConfigService.list(itemQueryReq)).build();
    }

    @GetMapping("/activity/culture-creative-config/delete")
    public RestResult delete(@RequestParam("id") String id) {
        return RestResultBuilder.builder().success().data(activityCultureCreativeConfigService.delete(id)).build();
    }


}
